import {login, faq} from "./request.js";
(async function () {
  let res = await login();
  let token = res.data.token;
  // 生活在蚂蚁
//   let Focus = await focus(token);
  // 社会招聘
  let Faq = await faq(token);
  // let faqItem = Focus.data.rows;
  // console.log(faq)

  let faqItem = Faq.data.rows;
//   console.log(faqItem);
  let faqArr = faqItem.filter((item) => {
    return item.sketch === "FAQ";
  });
  console.log(faqArr);

  faqFn(faqArr);
})();

// 获取面试相关 元素
let fagA = document.querySelector(".pictures_box");
// 面试相关元素 数据渲染

// 循环数组函数
function faqFn(data){
    let str ="";
    data.forEach((item)=>{
        str += `
        <div class="left">
        <img
        src=${item.cover}
          alt=""
        />
        ${item.content}
      </div>
        `;
    });
    fagA.innerHTML = str;
};